<template>
	<el-descriptions title="" :column="1" border>
		<el-descriptions-item v-for="(value,index) in columns" :key="index">
			<template #label> {{ value.label }} </template>
			<div v-show="!['True','False'].includes(data[value.prop])">{{ data[value.prop] }}</div>
			<div v-show="['True','False'].includes(data[value.prop])">
				<el-tag :type="data[value.prop]==='True' ? 'success' : ''">
							{{ data[value.prop]==='True' ? '公开' : '秘密' }}
				</el-tag>
			</div>
		</el-descriptions-item>
	</el-descriptions>
</template>

<script lang="ts" setup>
const props = defineProps({
	data: {
		type: Object,
		required: true
	}
});

interface TableItem {
  [key: string]: string | number;
}

const columns = [
  { label: "议题名称", prop: "name" },
  { label: "公开程度", prop: "publicity" },
  { label: "汇报人", prop: "reporter" },
  { label: "上传时间", prop: "preset_time" },
  { label: "审核情况", prop: "state" },
  { label: "审核建议", prop: "proposal" },
  { label: "议题附件", prop: "file" },
];
</script>
